package com.byzk.p2p.admin.borrow.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.byzk.p2p.admin.borrow.dto.Borrow;
import com.byzk.p2p.admin.borrow.dto.BorrowApply;
import com.byzk.p2p.admin.borrow.dto.BorrowApplyOff;
import com.byzk.p2p.admin.borrow.vo.BorrowApplyVo;
import com.byzk.p2p.admin.borrow.vo.BorrowRepayExportVo;
import com.byzk.p2p.admin.borrow.vo.BorrowTempVo;
import com.byzk.p2p.admin.borrow.vo.BorrowVo;
import com.byzk.p2p.admin.money.dto.BorrowPaymentDetail;
import com.byzk.p2p.admin.money.vo.SumMoneyVo;

public interface BorrowDao {
	
	public Integer countByStatus(BorrowApplyVo vo);

	public List<BorrowApplyVo> listBorrowApply(BorrowApplyVo vo);
	
	public BorrowApplyVo getBorrowApplyVoById(Integer id);
	
	public BorrowApply getBorrowApplyById(Integer id);
	
	public Integer insert(BorrowApply entity);

	public Integer update(BorrowApply entity);
	
	public Integer insertBorrow(Borrow borrow);

	public Integer updateBorrow(Borrow borrow);
	
	public Integer countBorrow(BorrowVo borrowVo);
	
	public List<BorrowVo> listBorrow(BorrowVo borrowVo);
	
	public SumMoneyVo sumBorrow(BorrowVo borrowVo);
	
	public Integer countNewBorrow(BorrowVo borrowVo);
	
	public List<BorrowVo> listNewBorrow(BorrowVo borrowVo);
	
	public List<Borrow> listBorrowExceptNew(BorrowVo borrowVo);
	
	public Borrow getBorrowById(Integer id);
	
	public BorrowVo getBorrowVoById(@Param("id")Integer id);
	
	public List<BorrowTempVo> getBorrowVoByUid(Integer uid);
	
	public Integer getBorrowCount(BorrowTempVo borrow);

	public List<BorrowTempVo> getBorrow(BorrowTempVo borrow);
	
	public List<Borrow> top3BorrowList(String status);
	
	public List<Borrow> lastBorrowList(@Param("count")Integer count);
	
	public List<Borrow> listLastNewBorrow();
	
	public Borrow lastBorrow();
	
	public List<BorrowTempVo> listByExportVo(BorrowRepayExportVo vo);
	
	public Integer getBorrowRepayCount(BorrowTempVo borrow);

	public List<BorrowTempVo> getBorrowRepay(BorrowTempVo borrow);
	
	public SumMoneyVo sumNewBorrow(BorrowVo borrowVo);
	
	public SumMoneyVo sumCompleteBorrow(BorrowTempVo borrowVo);
	
	public BorrowVo getborrowPaymentById(Integer id);
	
	public BorrowVo getborrowPayById(Integer id);
	
	public Integer countAll();
	
	public Borrow getByCode(String code);
	
	public Borrow platinaBorrow();
	
	public Borrow newBorrow();
	
	public List<BorrowVo> borrowList(BorrowVo borrowVo);
	
	public List<Borrow> lastBorrowListVo(@Param("productId")Integer productId,@Param("count")Integer count);

	public Borrow selectByPmerBillNo(String pMerBillNo);
	
	public int insertBorrowApplyOff(BorrowApplyOff off);
	
	public int updateBorrowApplyOff(BorrowApplyOff off);
	
	public List<BorrowApply> selectBorrowApplyByUserId(int userId);
	
	public Integer countBorrowAll(BorrowVo borrowVo);
	
	public SumMoneyVo statisticByUserId(Integer userId);
	
	public SumMoneyVo paymentNumber(Integer userId);
	
	 /**
	  * 
	 * <p>Description:获取还款中的标 </p>
	 * <p>Company:xbd </p>
	 * @author:lilei
	 * @date:2016年9月27日下午5:30:09
	  */
	public List<BorrowVo>  getborrowPaymentList();
	
	/**
	 * 
	* <p>Description：更新还款记录中的利息管理费 </p>
	* <p>Company:xbd </p>
	* @author:lilei
	* @date:2016年9月27日下午5:33:11
	 */
   public Integer updateBorrowDetailByTid(BorrowPaymentDetail borrowdetail);
   
   /**
    * 
   * <p>Description:查看借款详情信息 </p>
   * <p>Company:xbd </p>
   * @author:lilei
   * @date:2016年9月28日下午2:57:27
    */
   public List<BorrowPaymentDetail>  paymentDetailByBorrowId(Integer borrow_id);
   
   /**
    * 
   * <p>Description: 编辑还款标信息</p>
   * <p>Company:xbd </p>
   * @author:lilei
   * @date:2016年9月30日上午9:32:28
    */
   public  Integer resiveBorrowInfo  (Borrow borrow);
}
